const { writeFail,writeOk } = require('./util')

const user = {
    username:'wennn',
    password:'1',
}



module.exports={
    'GET /api/user': {id: 1, username: 'kenny', sex: 6 },
    'GET /api/user/list': [
      {id: 1, username: 'kenny', sex: 6 },
      {id: 2, username: 'kenny', sex: 6 }
    ],
    'POST /api/login/account': (req, res) => {
      const { password, username } = req.body;
      if (password === '888888' && username === 'admin') {
        return writeOk(res,{
            token: "sdfsdfsdfdsf",
            data: {id: 1, username: 'kenny', sex: 6 }
        }) 
      } else {
        return writeFail(res,"账号或者密码错误");
      }
    },
    'DELETE /api/user/:id': (req, res) => {
      console.log('---->', req.body)
      console.log('---->', req.params.id)
    //   res.send({ status: 'ok', message: '删除成功！' });
      writeOk(res,"删除成功")
    },
}